package sjms.create.builder;

/**
 * @ClassName:
 * @Description:
 * @Author fcb
 * @Date 2020/5/25 16:03
 */
public class Director {

    private CarBuilder carBuilder;

    public Director(CarBuilder carBuilder){
        this.carBuilder = carBuilder;
    }

    public void setBuilder(CarBuilder carBuilder){
        this.carBuilder = carBuilder;
    }

    public void createBaoMa(){
        carBuilder.setBrand("宝马");
        carBuilder.setName("宝马汽车");
    }

    public Car getCar(){
        return this.carBuilder.getCar();
    }
}
